import dynamic from "next/dynamic"
import React from "react"

/**
 * 节点类型
 */
export type NodeTypeConfig = {
  ContentComponent: React.ComponentType<any>
}

/**
 * 节点类型配置
 */
export const nodeTypeConfigs: Record<string, NodeTypeConfig> = {
  start: {
    ContentComponent: dynamic(() => import("./start"))
  }
}

/**
 * 获取节点类型配置
 *
 * @param type 类型
 */
export const getNodeTypeConfig = (type: string) => {
  return nodeTypeConfigs[type]
}
